<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Global</title>
</head>
<body>

</body>

<script>
    // URI的编解码
    var realUrl = "http://localhost:63342/JavaEEStudyProj/HtmlCSSStudy/JSTest/6.JS%E5%AF%B9%E8%B1%A1_Regex.html?_ijt=antkevmjsetpskrodj5c5uivn3";
    document.write("realUrl=" + realUrl + "<br>")
    document.write("decodeURI(realUrl)=" + decodeURI(realUrl) + "<br>")
    document.write("encodeURI(\"你好\") =" + encodeURI("你好") + "<br>")

    document.write("encodeURIComponent(\"你好\") =" + encodeURIComponent("你好") + "<br>")
    document.write("encodeURIComponent(\"%E4%BD%A0%E5%A5%BD\") =" + decodeURIComponent("%E4%BD%A0%E5%A5%BD") + "<br>")

    // parseInt 字符串转数字
    // 逐一判断，转换数字部分
    document.write("parseInt(\"123aa\")=" + parseInt("123aa") + "<br>")
    document.write("parseInt(\"aaa123bbb\")=" + parseInt("aaa123bbb") + "<br>")
    document.write("parseInt(\"0ab\")=" + parseInt("0ab") + "<br>")

    var nanVal = NaN
    document.write("nanVal=" + nanVal + "<br>")
    document.write("isNaN(nanVal)=" + isNaN(nanVal) + "<br>")
    document.write("(nanVal == NaN) =" + (nanVal == NaN) + "<br>")

    // eval 执行字符串脚本
    eval("alert(\"OK\")");


</script>
</html>